<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>呼吸灯</title>
    <style>
        *{
            box-sizing:border-box;
        }
        div.article{
            width:250px;
            height:350px;
            background-color: black;
            margin:0 auto;/*块级元素水平居中,0代表上下。auto代表左右*/
        }
        div.top{
            width:250px;
            height:250px;
            padding:20px;/*内边距*/
            animation-name: outer;
            animation-duration: 5s;
            animation-iteration-count: infinite;
            animation-timing-function: linear;
        }
        div.text{
            color:#fff;
            text-align: center;/*文本水平居中*/
        }
        div#outer{
            height:100%;/*占父级百分之百*/
            border:5px solid #ccc;
            border-radius:50%;/*设定圆角边框，设置大小为div的50%时成为圆*/
            padding:20px;
            animation-name: inner;
            animation-duration: 5s;
            animation-iteration-count: infinite;
            animation-timing-function: linear;
        }
        div#inner{
            height:100%;
            border:10px solid #fff;
            border-radius:50%;
        }
        @keyframes outer{
            25%{
                padding:10px;
            }
            50%{
                padding: 20px;
            }
            100%{
                padding:20px;
            }
        }
        @keyframes inner{
            25%{
                padding:30px;
            }
            50%{
                padding: 20px;
            }
            75%{
                padding:32px;
            }
            100%{
                padding: 20px;
            }
        }
    </style>
</head>
<body>
    <div class="article">
        <div class="top">
            <div id="outer">
                <div id="inner"></div>
            </div>
        </div>
        <div class="text">hi~</div>
    </div>
</body>
</html>